﻿<%@ Page Language="C#" MasterPageFile="~/MangerPage.master" AutoEventWireup="true" CodeFile="Manger_ResourceAdd.aspx.cs" Inherits="Manger_ResourceAdd" Title="添加/编辑资源" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/xml/ResourceType_000000.xml">
    </asp:XmlDataSource>
  <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Jxzy_Database %>" OnInserted="SqlDataSource1_Inserted" OnUpdated="SqlDataSource1_Updated">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Jxzy_Database %>"
        SelectCommand="SELECT [Course_Name], [Course_ID] FROM [zyk_Courses] WHERE ([Course_MajorID] = @Course_MajorID)">
    </asp:SqlDataSource>
    <asp:HiddenField ID="hfType" runat="server" Value="0" />
    <div style="float:left"><asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1" ShowLines="True" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged" Visible="False">
        <DataBindings>
            <asp:TreeNodeBinding DataMember="siteMapNode" TextField="typename" ValueField="typeid" />
        </DataBindings>
        <ParentNodeStyle Font-Bold="False" />
        <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
        <SelectedNodeStyle BackColor="#C0C0FF" Font-Bold="True" Font-Underline="False" HorizontalPadding="0px"
            VerticalPadding="0px" />
        <NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px"
            NodeSpacing="0px" VerticalPadding="1px" />
    </asp:TreeView></div>
    <div style="float:left;line-height:30px; text-align: center;">
        <div style="text-align: left">
           <asp:Button ID="btSelect" runat="server" OnClick="btSelect_Click" Text="选择资源类型" />&nbsp;
            发表到：&nbsp;
            <asp:TextBox ID="tbType" runat="server" BorderColor="White" BorderStyle="None"
                Font-Bold="True" ReadOnly="True" Width="320px"></asp:TextBox>
            <asp:Label ID="lbTypePath" runat="server" Visible="False"></asp:Label>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="tbType"
                ErrorMessage="请选择资源类型" ValidationGroup="1"></asp:RequiredFieldValidator></div>
            <table id="mytable" border="0" cellpadding="0" cellspacing="0" width="700">
                <tr>
                    <td colspan="3" style="height: 30px; text-align: left">
                    资源名称：<asp:TextBox ID="tbResourceName" runat="server" Width="465px"></asp:TextBox>&nbsp;
            *<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbResourceName"
                ErrorMessage="标题不能为空" ValidationGroup="1"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="text-align: left">上传资源：<asp:TextBox ID="tbResourceURL" runat="server" Width="291px"></asp:TextBox>&nbsp;
             <asp:FileUpload ID="FileUpload1" runat="server" Width="26px" />
             <asp:Button ID="btUpload" runat="server" OnClick="btUpload_Click" Text="上传" />
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="text-align: left">
                        地址转向：<asp:TextBox ID="tbRedirect" runat="server" Width="391px">http://</asp:TextBox>点击资源链接时自动转向的URL</td>
                </tr>
                <tr>
                    <td colspan="3" style="text-align: left">
        作者：<asp:TextBox ID="tbWriter" runat="server"></asp:TextBox>&nbsp; 文件大小：<asp:TextBox ID="tbFileSize" runat="server" Width="26px" ReadOnly="True">0</asp:TextBox>KB
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="text-align: left">预览图：<asp:Image ID="preImage" 
                            runat="server" Height="135px" ImageUrl="/img/noimage.bmp" Width="200px" />
             <asp:FileUpload ID="ImageUpload" runat="server" Width="26px" />
             <asp:Button ID="btUploadImage" runat="server" OnClick="btUploadImage_Click" Text="上传" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: left">
                        关键字：<asp:TextBox ID="tbKeyWord" runat="server" Width="260px"></asp:TextBox></td>
                    <td style="text-align: left">
                        来源：<asp:TextBox ID="tbFrom" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: left">
                        出版社：<asp:TextBox ID="tbPublish" runat="server" Width="262px"></asp:TextBox>
                    </td>
                    <td style="text-align: left">出版时间：<asp:TextBox
                ID="tbEditDate" runat="server"></asp:TextBox></td>
                </tr>
                                <tr>
                    <td colspan="3" style="text-align: left"> <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" Height="200px" ToolbarSet="Basic" Width="100%">
    </FCKeditorV2:FCKeditor> 
                    </td>
                </tr>
                
                <tr>
                    <td style="text-align: left; width: 311px;" rowspan="4">
                        <asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource2" DataTextField="Course_Name"
                            DataValueField="Course_ID" Height="75px" SelectionMode="Multiple" Width="100%"></asp:ListBox></td>
                    <td style="width: 84px; text-align: center">
                        <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text=">>" /></td>
                    <td rowspan="4">
                        <asp:ListBox ID="ListBox2" runat="server" SelectionMode="Multiple" Width="100%"></asp:ListBox></td>
                </tr>
                <tr>
                    <td style="width: 84px; text-align: center">
                        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text=" > " /></td>
                </tr>
                <tr>
                    <td style="width: 84px; text-align: center">
                        <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text=" < " /></td>
                </tr>
                <tr>
                    <td style="width: 84px; text-align: center">
                        <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="<<" /></td>
                </tr>
            </table>
            <asp:Button ID="btNewsAdd" runat="server" Text="添加资源" OnClick="btNewsAdd_Click" ValidationGroup="1" /></div>


</asp:Content>

